<?php

namespace JLPay\Models\Openmerch\Bill;

use JLPay\Models\BaseRequest;

/**
 * 订单信息查询请求
 * 
 * @author liaochangyi
 * @since 2025-01-25
 */
class OrderInfoQueryRequest extends BaseRequest
{
    /**
     * API URL
     */
    public const API_URL = '/open/bill/trans-charge/query';

    protected ?string $orderId = null;  // 嘉联订单号

    /**
     * 设置嘉联订单号
     *
     * @param string $orderId
     * @return self
     */
    public function setOrderId(string $orderId): self
    {
        $this->orderId = $orderId;
        return $this;
    }

    /**
     * 获取嘉联订单号
     *
     * @return string|null
     */
    public function getOrderId(): ?string
    {
        return $this->orderId;
    }

    /**
     * 转换为数组
     *
     * @return array
     */
    public function toArray(): array
    {
        $data = parent::toArray();
        $data['order_id'] = $this->orderId;
        return $data;
    }
} 